package August;

import java.util.Scanner;

public class Day0813 {
    static int[] day = {31,28,31,30,31,30,31,31,30,31,30,31};
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            int year = scanner.nextInt();

            int week ;
            System.out.printf("%d-01-01\n",year);
            week = week1(year,1,1);
            System.out.printf("%d-01-%02d\n",year,m1(week,3,1));

            week = week1(year,2,1);
            System.out.printf("%d-02-%02d\n",year,m1(week,3,1));

            week = week1(year,6,1);
            System.out.printf("%d-05-%02d\n",year,m2(week));

            System.out.printf("%d-07-04\n",year);

            week = week1(year,9,1);
            System.out.printf("%d-09-%02d\n",year,m1(week,1,1));

            week = week1(year,11,1);
            System.out.printf("%d-11-%02d\n",year,m1(week,4,4));

            System.out.printf("%d-12-25\n",year);

            System.out.println();
        }
    }
    public static boolean runYear(int x){
        if ((x%100!=0&&x%4==0) || x%400 == 0){
            return true;
        }
        return false;
    }

    public static int days(int year,int month,int day1){
        int n = day1;
        for (int i = 0; i < month-1; i++) {
            n += day[i];
        }
        if (month>2 && runYear(year))
            n++;
        return n;
    }


    public static int d1(int year,int month,int day){
        return (year-1)+(year-1)/4-(year-1)/100+(year-1)/400+days(year,month,day);
    }

    public static int week1(int year,int moth,int day ){
        int week = d1(year,moth,day)%7;
        if (week == 0)
            return 7;
        return week;
    }

    public static int m1(int w,int n,int e){
        return 1 + (n - 1) * 7 + (7 - w + e) % 7;
    }

    public static int m2(int w){
        int d = (w == 1 ? 7 : w - 1);
        return 32 - d;
    }
}
